package com.smartao.base.acl;

import java.util.*;

/**
 * PermissionFactory 负责把tag里的权限名转换成Permission
 * @author sunxing
 */
public class PermissionFactory {
	static Map<String, Permission> permissions = new HashMap<String, Permission>();
	static{
		permissions.put("READ", Permission.READ);
		permissions.put("WRITE", Permission.WRITE);
		permissions.put("DELETE", Permission.DELETE);
		permissions.put("ADMIN", Permission.ADMIN);
	}
	
	public static Permission getByName(String name){
		return permissions.get(name);
	}
}
